using System;
using System.Collections.Generic;
using System.Linq;
using SuCasa.Controllers;
using SuCasa.Infrastructure;

namespace SuCasa.DataAccess{
    public class FakeMemberRepository : IMemberRepository {
        public IEnumerable<Member> All{
            get{
                return FakeDb.AllMembers;
            }
        }

        public bool AddMember(Member member){
            FakeDb.AllMembers.ToList().Add(member);
            return true;
        }

        public bool AddCourse(int memberId, Course course){
            FakeDb.AllCourses.ToList().Add(course);
            return true;
        }

        public IEnumerable<Member> GetAll()
        {
            return FakeDb.AllMembers;
        }

        public IEnumerable<Member> GetMembers(string query){
            return FakeDb.AllMembers;
        }

        public Member GetMemberBy(Func<Member, bool> func){
            return FakeDb.AllMembers.First();
        }

        public void Delete(int id){
            
        }

        public IEnumerable<MemberType> GetMemberTypes(){
            return FakeDb.AllMemberTypes;
        }
    }
}